<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="huoyun" uri="/huoyun" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>运策网 - 用户注册</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/main.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/theme/css/style_reg.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/jquery-1.6.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/jquery.validate.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/theme/js/additional-methods.js" charset="utf-8"></script>
	<script type="text/javascript">
	  $(document).ready(function(){
	  	$("#regUserForm").validate({
	  	rules : {
	  		"user.username" : {
	  			required : true,
	  			username : true,
	  			remote : {
	  				url : "${pageContext.request.contextPath}/user/checkUser.action",
	  				type : "post"
				}
	  		},
	  		"user.password" : {
	  			required : true,
	  			maxlength : 20,
	  			minlength : 6
	  		},
	  		"verifyPassword" : {
	  			required : true,
	  			equalTo : "#password"
	  		},
	  		"user.email" : {
	  			email : true,
	  			maxlength : 100
	  		},
	  		"verifyCode" : {
	  			required : true
	  		}
	  	},
	  	messages : {
	  		"user.username" : {
	  			required : "请输入用户名",
	  			username : "用户名应该是6-16位数字、字符和\"_\"组成",
	  			remote : "该用户名不可用，请更换用户名"
	  		},
	  		"user.password" : {
	  			required : "请输入密码",
	  			maxlength : "密码应该在6到20位之间",
	  			minlength : "密码应该在6到20位之间"
	  		},
	  		"verifyPassword" : {
	  			required : "请再次输入密码",
	  			equalTo : "两次输入的密码不一致"
	  		},
	  		"user.email" : {
	  			email : "请输入正确的电子邮箱",
	  			maxlength : "电子邮箱不能多于100个字符"
	  		},
	  		"verifyCode" : {
	  			required : "请输入验证码"
	  		}
	  	}
	  	});
	  });
  </script >
  <script type="text/javascript">
  	$(function(){
  		
  		$.ajax({
    		type : "post",
    		url  : "${pageContext.request.contextPath}/channel/latestCargoAndCar.action",
    		dataType : "html",
    		success : function(data)
    		{
    			$("#main_right").html(data);
    		}
    	});
  		
  	})
  </script>
  
   </head>
	<body>
		<div class="main_wrap clearfix">
			<a title="运策网 " href="<s:url action="index.action" namespace="/channel"></s:url>">
				<div class="reg_logo">
				</div>
			</a>
			<div class="guide-reg clearfix">
				<div class="main_left">
					<div class="form_wrap clearfix">
						<span class="login">已有运策网帐号，<a href="${pageContext.request.contextPath}/user/preLogin.action">登录</a>
						</span>
						<div class="user_wrap clearfix">
							免费注册运策网帐号
						</div>
						<div style="color: red;margin-left:100px;"><s:property value="resultMsg"/><s:fielderror></s:fielderror></div>
						<s:url var="registerUserUrl" action="register.action" namespace="/user"></s:url>
						<form method="post" id="regUserForm" name="regUserForm" action="<s:property value="#registerUserUrl"/>">
    						<dl>
								<dt>
									<label for="user.username">
										帐号类型:
									</label>
								</dt>
								<dd>
									<input type="radio" name="accountType" value="1" checked="checked"/>&nbsp;货主
									&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" name="accountType" value="2"/>&nbsp;车主
								</dd>
							</dl>
							<dl>
								<dt>
									<label for="user.username">
										输入帐号:
									</label>
								</dt>
								<dd>
									<input type="text" name="user.username" id="user.username"
										class="inputtext" />
								</dd>
							</dl>
							<dl>
								<dt>
									<label for="user.password">
										创建密码:
									</label>
								</dt>
								<dd>
									<input type="password" maxlength="20" name="user.password"
										id="password" class="inputtext" />
								</dd>
							</dl>
							<dl>
								<dt>
									<label for="verifyPassword">
										确认密码:
									</label>
								</dt>
								<dd>
									<input type="password" name="verifyPassword" id="verifyPassword"
										class="inputtext" />
								</dd>
							</dl>
							<dl>
								<dt>
									<label for="user.email">
										注册邮箱:
									</label>
								</dt>
								<dd>
									<input type="text" name="user.email" id="user.email" class="inputtext" />
								</dd>
							</dl>
							<dl>
								<dt>
									<label for="verifyCode">
										验证码:
									</label>
								</dt>
								<dd>
									<input type="text" name="verifyCode" id="verifyCode"
										class="inputtext validate-code" size="5" maxlength="6" />
									<img id="newVerifyCode" src="${pageContext.request.contextPath}/authImage" onclick="getNewVerifyCode()"/>
    								<a href="javascript:void(0);" onclick="getNewVerifyCode()">看不清换一张？</a></td>
    								 <script type="text/javascript">
									    function getNewVerifyCode()
									    {
									    	$("#newVerifyCode").attr("src",$("#newVerifyCode").attr("src").split("?")[0] +"?timestamp="+ Math.random());
									    }
									</script>
								</dd>
							</dl>
							<dl>
								<dt>
									&nbsp;
								</dt>
								<dd>
								<div class="button button-lorange">
									<input id="button_submit" type="submit" value="同意协议并注册" class="button-text">
								</div>
								<div>
									<a href="#" target="_blank">《货运网服务条款》</a>
								</div>
								
								</dd>
							</dl>
						</form>
					</div>
				</div>
				<div class="main_right" id="main_right">
					
				</div>
				<div class="b_text">
					<jsp:include page="/footer.jsp"></jsp:include>
				</div>
			</div>
		</div>
	</body>
</html>
